#ifndef COCOSHELPER_H_20120131
#define COCOSHELPER_H_20120131

#include "cocos2d.h"

const float PI = 3.14159f;

class CAnimationHelper
{
public:
	static cocos2d::CCAction *Animate(cocos2d::CCSprite *pSprite, int startFrame, int nFrames, const char *szNameFormat, float delay, 
		int times = 0, float startTime = 0.0f, bool bRestore = false);

	static cocos2d::CCAnimate *BuildAnimate(int startFrame, int nFrames, const char *szNameFormat, float delay, 
		float startTime = 0.0f, bool bRestore = false);

	static cocos2d::CCAction *AnimateWithCall(cocos2d::CCObject *pTarget, cocos2d::SEL_CallFunc selector, cocos2d::CCSprite *pSprite, int startFrame, 
		int nFrames, const char *szNameFormat, float delay, float startTime = 0.0f, bool bRestore = false);
};

class CMathHelper
{
public:
	static float CalRotation(cocos2d::CCPoint ptStart ,cocos2d::CCPoint ptEnd);
	static cocos2d::CCPoint CalIncrement(float dir, float speed);
	static cocos2d::CCPoint CalIncrement(cocos2d::CCPoint ptStart, cocos2d::CCPoint ptEnd, float speed);
};
#endif